<!DOCTYPE html>
<%@ page language="java" import="com.compuvest.web.*,java.util.*,java.text.DecimalFormat" pageEncoding="UTF-8" %>

<%@ taglib uri="/WEB-INF/tld/head.tld" prefix="head" %>

<jsp:useBean id="sb" class="SQLBean" scope="application"/>
<jsp:useBean id="advertShow" class="AdvertShow" scope="application"/>
<jsp:useBean id="basket" class="Basket" scope="session"/>
<%!
    Items basketItems = new Items(); // for getResellerPriceLine()
%>
<%
   String https = application.getInitParameter("https");

    Customer cust = basket.getCustomer();
    if(cust == null) {
	response.sendRedirect(https + "CustomerForm.jsp");
	return;
    }

    // if not fill some fields -> CustomerEdit
    if(cust.getBilling().getFirstName().isEmpty() || cust.getBilling().getLastName().isEmpty() || cust.getBilling().getAddress1().isEmpty() ||
        cust.getBilling().getCity().isEmpty() || cust.getBilling().getState().isEmpty() || cust.getBilling().getCountry().isEmpty() ||
        cust.getBilling().getZip().isEmpty() || cust.getBilling().getPhone().isEmpty() || cust.getShipping().getFirstName().isEmpty() ||
        cust.getShipping().getLastName().isEmpty() || cust.getShipping().getAddress1().isEmpty() || cust.getShipping().getCity().isEmpty() ||
        cust.getShipping().getState().isEmpty() || cust.getShipping().getCountry().isEmpty() || cust.getShipping().getZip().isEmpty()) {

        response.sendRedirect(https + "CustomerEdit.jsp");
	return;
    }

    String http = application.getInitParameter("http");
    String info = application.getInitParameter("info");

    DecimalFormat priceForm = new DecimalFormat("$#,##0.00");
    DecimalFormat jsprice = new DecimalFormat("$#0.00");

    // finish select
    String mode = request.getParameter("mode");
    if(mode != null) {

	if(basket.notEmpty()) {

            basket.setNotes(request.getParameter("notes"));
            basket.setShippingCode(request.getParameter("scdb"));
            basket.setShippingDescription(request.getParameter("desb"));
            basket.setBlindShipping(request.getParameter("blind") != null ? true : false);
            basket.setSignatureRequired(request.getParameter("sgnch") != null ? true : false);

            // grand total
            basket.setGrandTotal(advertShow.getDouble(request.getParameter("totb"), 0d));

            // shipping
            basket.setShippingCost(advertShow.getDouble(request.getParameter("spb"), 0d));

            // tax
            basket.setTaxCost(advertShow.getDouble(request.getParameter("taxb"), 0d));

            basket.setPaymentMethod(advertShow.getString(request.getParameter("payMethod"), ""));

            // if credit card
            if("CC".equals(basket.getPaymentMethod())) {

		cust.setCName(cust.getBilling().getName());
		cust.setCExpMonth(request.getParameter("CExpMonth"));
		cust.setCExpYears(request.getParameter("CExpYears"));

		cust.setCNumberAdd(advertShow.getInt(request.getParameter("CNumberAdd"), 0));

                cust.setBankPhone(request.getParameter("bankPhone"));

		String ccnumber = advertShow.getString(request.getParameter("CNumber"), "");      // if diff card add new one
		if(!ccnumber.isEmpty() && !"0".equals(ccnumber) && !ccnumber.equals(cust.getCardNumberShow())) {
                    cust.setCardNumber(ccnumber);
		}
            }
            //else if("CD".equals(basket.getPaymentMethod())) {
		//cust.setCheckRoutingNumber(request.getParameter("checkRouting"));
		//cust.setCheckAccountNumber(request.getParameter("checkAccount"));
		//cust.setCheckNumber(request.getParameter("checkNumber"));
		//cust.setLicenseNumber(request.getParameter("licenseNumber"));
		//cust.setLicenseState(request.getParameter("licenseState"));
            //}
            // and to finish
            response.sendRedirect(https + "ThankYou.jsp");
            return;
	}
    } //if
    else {
        // update warranty
        String[] quantity = request.getParameterValues("quantity");
        String[] quantityID = request.getParameterValues("qtyID");
        String[] warranties = request.getParameterValues("warranty");
        if(quantity != null) {
            for(int i = 0; i < quantity.length; i++) {
                basket.setQuantity(advertShow.getInt(quantityID[i], 0), advertShow.getInt(quantity[i], 0), warranties[i]);
            }
        }
    }
%>
<html>
<head>
<title><%= application.getInitParameter("CompanyName") %></title>
<%@include file="./incl/scripts.txt" %>
</head>
<body>

<div id='cvbody'>

 <head:show />

 <div id='cvcont'>
  <table id='cvmain'>
  <colgroup><col width='80px'/><col width='*'/><col width='80px'/></colgroup>
  <tbody>
   <tr>
    <td id='cvleft' valign="top">

    </td>
    <td id='cvcenter' align="center" valign="top">

<div style='height:1em;'>&nbsp;</div>
<form id='Payment' action='<%= https %>Payment.jsp' onSubmit='return isPaymentDone(this);' method='POST'>

<%
    if(basket.isEmpty()) {
%>

<table class='part' style='width:60%;background-color:white;'>
 <colgroup><col width='50%'/><col width='50%'/></colgroup>
 <tr class='bsm' height='26'><th>Billing Information</th><th>Shipping Information</th></tr>
 <tr style='text-align:left;'>
  <td style='border-left:1px solid #d4d4d4;border-right:1px solid #d4d4d4;padding:10px 10px;'>
   <%= cust.getBilling().getCompany() %><br/>
   <%= cust.getBilling().getName() %><br/>
   <%= cust.getBilling().getAddress1() %><br/>
   <%= cust.getBilling().getAddress2() %><br/>
   <%= cust.getBilling().getCity() %>,
   <%= cust.getBilling().getState() %>
   <%= cust.getBilling().getZip() %>
   <%= cust.getBilling().getZip4() %>
   <%= cust.getBilling().getCountry() %><br/>
   Tel:&nbsp;&nbsp;&nbsp;<%= cust.getBilling().getPhone() %><br/>
   Cell:&nbsp;<%= cust.getBilling().getCell() %><br/>
   Fax:&nbsp;&nbsp;&nbsp;<%= cust.getBilling().getFax() %>
  </td>
  <td style='padding:10px 10px;'>
   <%= cust.getShipping().getCompany() %><br/>
   <%= cust.getShipping().getName() %><br/>
   <%= cust.getShipping().getAddress1() %><br/>
   <%= cust.getShipping().getAddress2() %><br/>
   <%= cust.getShipping().getCity() %>,
   <%= cust.getShipping().getState() %>
   <%= cust.getShipping().getZip() %>
   <%= cust.getShipping().getZip4() %>
   <%= cust.getShipping().getCountry() %><br/>
   Tel:&nbsp;&nbsp;&nbsp;<%= cust.getShipping().getPhone() %><br/>
   Cell:&nbsp;<%= cust.getShipping().getCell() %><br/>
   Fax:&nbsp;&nbsp;&nbsp;<%= cust.getShipping().getFax() %>
  </td>
 </tr>

 <tr height='26' class='bsm' align='center'>
  <td><a class='btlgr' href='<%= https %>CustomerEdit.jsp'>Edit Your Profile</a></td>
  <td><%= cust.getCustomerID() == 0 ? "&nbsp;" : "<a class='btlgr' href='" + https + "OrdersHistory.jsp'>Orders History</a>" %></td>
 </tr>
</table>
<%
    }
    else { //if(basket.isEmpty())
%>
 <input type='hidden' id='desb' name='desb' value=''/>

 <table class='part' border='1' bordercolor='#d4d4d4' style='width:70%;background-color:white;'>
  <colgroup><col width='10%'/><col width='64%'/><col width='10%'/><col width='6%'/><col width='10%'/></colgroup>
  <tr class='bsm' height='26'><th>Part #</th><th>Product Name</th><th>Price</th><th>Qty</th><th>Amount</th></tr>
<%
	boolean ground = false;
	String rowspan = "";
	for(ItemsInBasket item : basket.getContents()) {
	    rowspan = (item.getWarrantyMask() & Item.EXTENDED_WARRANTY) != 0 ? "rowspan='2'" : "";
%>
   <input type='hidden' name='qtyID' value='<%= item.getItemID() %>'/>
   <input type='hidden' name='quantity' value='<%= item.getTotalQuantity() %>'/>
  <tr style='background-color:#ffff<%= (ground = !ground) ? "df" : "ff" %>;text-align:center;'>
   <td <%= rowspan %> id='nowrap'><%= item.getAccwareCode() %><div style='font-size:10px;color:blue;'><%= item.getCondition() %></div></td>
   <td style="text-align:left;padding:1px 5px;">
    <a href="<%= http %>Desc.jsp?iid=<%= item.getItemID() %>" class='tlink'><%= item.getItemName() %></a>
     <%= basket.getReseller() ? basketItems.getResellerPriceLine(item) : "" %>
     <%= item.getPromotionPriceString(false) %>
   </td>
   <td>
<%	if(basket.getReseller() && item.getResPrice1() != 0d) { %>
      <div class='prices'><%= priceForm.format(item.getPrice()) %></div>
<%	} %>
     <%= priceForm.format(item.getSellPrice()) %><br/>
   </td>
   <td <%= rowspan %>><%= item.getTotalQuantity() %></td>
   <td><%= priceForm.format(item.getSellPrice() * item.getTotalQuantity()) %></td>
  </tr>
<%
	    // warranty &&  extended warranty any bit up ?
	    if((item.getWarrantyMask() & Item.EXTENDED_WARRANTY) != 0) {
%>
  <tr style='background-color:#ffff<%= ground ? "df" : "ff" %>;text-align:center;'>
   <td style="text-align:left;padding:1px 5px;">
     <div style='font-size:10px;'>Warranty : <%= item.getWarrantyDays() %>.</div>

    <span>Extended warranty : <img id='wty' class='tipz' src='./img/it/hlp.gif' alt='Extended warranty'/></span>
     <select name='warranty' size='1' style='width:150px;font-size:8pt;' onchange='document.id("Payment").submit();'>
      <option value='0|0.00'>No Thanks</option>
      <%=  item.getExtendedWarrantyOptions(item.getWarrantyPrice(), true) %>
    </select>
   </td>
   <td><%= item.getWarrantyPrice() == 0d ? "" : priceForm.format(item.getWarrantyPrice()) %></td>
   <td><%= item.getWarrantyPrice() == 0d ? "" : priceForm.format(item.getWarrantyTotal()) %></td>
  </tr>
<%
	    }
	    else {
                out.write("<input type='hidden' name='warranty' value='0'/>");
	    }
	}
%>
 <tr height='30'>
  <td colspan='5' align='right' style='padding:0 14px;'>
   <font style="color:red;"><%= basket.getCouponMessage(false) %></font><br/>
   Subtotal: <%= priceForm.format(basket.getTotal(true)) %>
  </td>
 </tr>

 <tr>
  <td colspan='5'>
   <table>
   <colgroup><col width='25%'/><col width='40%'/><col width='35%'/></colgroup>
    <tr>
     <td align='right' style='padding-right:9px;'>
       <span class='ship2'>Please select Shipping method :</span><br/>
       <a href='<%= info %>Shipping.jsp' style='padding-right:9px;font-size:10px;text-decoration:none;color:#00f5fa;'>* General Shipping Information.</a>
     </td>
     <td style='border-left:1px solid #d4d4d4;border-right:1px solid #d4d4d4;'>
<%
    boolean isUSAorCanada = (("US".equals(cust.getBilling().getCountry())) || ("CA".equals(cust.getBilling().getCountry())));

    ArrayList<ShipRate> shippRate;
    if("US".equals(cust.getShipping().getCountry())) {
        shippRate = sb.getShippingChartUS(cust.getShipping().getZip(), basket.getTotalWeight());
    }
    else {
        shippRate = sb.getShippingChart(cust.getShipping().getCountry(), basket.getTotalWeight());
    }

    double tax = "WA".equals(cust.getShipping().getState()) ? basket.getTotal(true) * basket.WA_TAX_FEE : 0d;

    StringBuilder json = new StringBuilder(300);
    json.append("{data:[");

    StringBuilder rdo = new StringBuilder(300);
    rdo.append("<div class='ship2' style='padding-left:4px;'>");
    rdo.append("<input type='checkbox' id='sgnch' name='sgnch' ").append(basket.getSignatureRequired() ? "checked='checked'" : "");
    rdo.append(" onClick='gship.setSign();'/> ").append(priceForm.format(basket.getSignaturePrice()));
    rdo.append(" - <span id='sgn' class='tipz'>signature required <img id='sgn' class='tipz' src='./img/it/hlp.gif' alt=''/></span><br/>");

    int idx = 0; String groundLine;
    for(ShipRate ship : shippRate) {
        groundLine = jsprice.format(ship.getShipPrice()) + " - " + ship.getDescription();
        // free shipping for froogle and all googleXX and cws bing (fdg == ground)
        if("fdg".equals(ship.getShipCode())) {
            String advName = basket.getCompuvestCookies().getAdvertSite();
            if(advertShow.isFreeShipping(advName)) {
            //if(advName.contains("oogle") ||
            //        advertShow.getAdvertID(advName) == AdvertShow.ADV_CWS ||
            //        advertShow.getAdvertID(advName) == AdvertShow.ADV_CWM ||
            //        advertShow.getAdvertID(advName) == AdvertShow.BING) {

                ship.setShipPrice(0d, 0d);
                groundLine = ShipRate.STR_FREE_SHIPPING;
            }
        }

        json.append(idx++ > 0 ? "," : "").append("{");
        json.append("shmd:'").append(ship.getShipCode());
        json.append("',shprc:").append(ship.getShipPrice());
        json.append(",sgprc:").append(basket.getSignaturePrice());
        json.append(",shdesc:'").append(ship.getDescription());
        json.append("',tax:").append(tax);
        json.append(",total:").append(basket.getTotal(true) + tax + ship.getShipPrice());
        json.append("}");

        rdo.append("<input id='").append(ship.getShipCode()).append("' type='radio' name='ship_opt' value='").append(ship.getShipCode()).append("' onclick='gship.setShipping(this.value);'/> ");
	rdo.append(groundLine).append("<br/>");
    }
    json.append("]}");

    rdo.append("</div>");
    rdo.append("<p style='color:red;font-size:10px;padding:5px 10px;'>Cost shown is estimated. You will be contacted as cost may vary.</p>");

    out.write(rdo.toString());

    out.write("\n<script type='text/javascript'>\nvar gship; window.addEvent('domready', function(){ gship=new setGroundShipping(" + json.toString() + "); });\n</script>\n");
%>
     </td>
     <td valign='bottom' align='right'>
<%
    StringBuilder totlist = new StringBuilder();
    totlist.append("<span class='ship2' id='sgnout'></span><br/>");

    totlist.append("<span style='display:").append("WA".equals(cust.getShipping().getState()) && "US".equals(cust.getShipping().getCountry()) ? "inline" : "none");
    totlist.append(";' class='ship2'>WA Tax: <input id='taxb' name='taxb' value='' size='10' readonly/></span><br/>");

    totlist.append("<span id='desview' class='ship2'></span>\n");
    totlist.append("<span class='ship2'><input id='spb' name='spb' value='' size='10' readonly/></span><br/>\n");

    totlist.append("<input type='hidden' id='scdb' name='scdb' value=''/>\n");
    totlist.append("<span class='ship2'>Total Amount : <input  id='totb' name='totb' value='' size='10' readonly/></span>\n");

    if(basket.getReseller()) {
	totlist.append("<br/><span class='ship2'>Blind Shipping: <input type='checkbox' name='blind' ").append(basket.getBlindShipping() ? "checked=checked" : "").append(" value='Y'/></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;");
    }
    out.write(totlist.toString());
%>
     </td>
    </tr>
    <tr><td colspan='2' style="text-align:center;color:red;padding:5px 10px;font-size:10px;">Alaska, Hawaii and Guam  may have additional surcharges.  For accurate shipping costs please email <a href="mailto:info@compuvest.com">info@compuvest.com</a></td><td colspan='2' style="border-left:1px solid #d4d4d4;"></td></tr>
   </table>

  </td>
 </tr>

 <tr>
  <td colspan='5' align='right'>Comments (max 40) : <input name='notes' size='80' maxlength='40' value='<%= basket.getNotes() %>'/><br/>
   <b style='font-size:10px;'>(Please enter any additional comments you would like to include for our processing department)</b>
  </td>
 </tr>
 <tr class='bsm'>
  <td colspan='2' style='text-align:left;'><a class='btlgr' href='<%= https %>CustomerEdit.jsp'>Edit Your Profile</a></td>
  <td colspan='2'><%= cust.getCustomerID() == 0 ? "&nbsp;" : "<a class='btlgr' href='" + https + "OrdersHistory.jsp'>Orders History</a>" %></td>
  <td colspan='2' align='right'><a class='btgn hbl2' href='javascript:;' onClick="javascript:window.open('<%= info %>PopPolicies.jsp','','toolbar=no,scrollbars=yes,width=650,height=650,left=50,top=50');">Return<br/>Policy</a></td>
 </tr>
 </table>
<br/>

<h4 style='color:red;font-weight:bold;font-size:16px;'>SELECT YOUR PAYMENT.</h4>
<input type='hidden' id='payMethod' name='payMethod' value=''/>

<div style='padding:5px 5px;width:65%;'>
<div id="cvTabs">
 <ul>
<%
     if(isUSAorCanada) {
%>
  <li><a class="tab" href='CC'><span>Credit Card</span></a></li>
<%      } %>
  <li><a class="tab" href='PP'><span>PayPal</span></a></li>
<%      if(isUSAorCanada) { %>
  <%--li><a class="tab" href='CD'><span>By Check</span></a></li--%>
<%      } %>
  <li><a class="tab" href='UN'><span>Western Union</span></a></li>
<%      if(! isUSAorCanada) { %>
  <li><a class="tab" href='WT'><span>Wire Transfer</span></a></li>
<%      } %>
<%--
  <li><a class="tab" href='GG'><span>Google</span></a></li>
--%>

 </ul>

 <div> <%-- panels --%>

<%      if(isUSAorCanada) { %>
  <div class="panel" style="padding: 20px 10px;" id="CC">

   <table id='custform' style='text-align:left;'>
    <tr><td>&nbsp;</td><td><img src='../img/it/credit.jpg' alt=""/></td></tr>
    <tr>
     <th>CC Number :</th>
     <td>
      <input type='text' name='CNumber' size='16' maxlength='16' value='<%= cust.getCardNumberShow() %>' onChange='this.value=isCreditCard(this)'/>
	<b style='color:#800000'> CVV:</b>
      <input type='text' name='CNumberAdd' size='4' maxlength='4' value='<%= cust.getCNumberAdd() == 0 ? "" : cust.getCNumberAdd() %>'/>
      <div class='sbutm'><a href='javascript:;' onclick="javascript:window.open('<%= info %>CreditCard.jsp','','toolbar=no,scrollbars=no,width=650,height=600,left=100,top=50');">Help</a></div>
     </td>
    </tr>
    <tr>
     <th>Expires(mm/yy) :</th>
     <td>
      <table>
       <tr>
        <td>
         <select name='CExpMonth' size='1' style='width:50px;'>
	  <option value='<%= cust.getCExpMonth() %>'><%= cust.getCExpMonth() %></option>
          <option value='01'>01</option>
          <option value='02'>02</option>
          <option value='03'>03</option>
          <option value='04'>04</option>
          <option value='05'>05</option>
          <option value='06'>06</option>
          <option value='07'>07</option>
          <option value='08'>08</option>
          <option value='09'>09</option>
          <option value='10'>10</option>
          <option value='11'>11</option>
          <option value='12'>12</option>
         </select>
         <b> / </b>
         <select name='CExpYears' size='1' style='width:70px;'>
	  <option value='<%= cust.getCExpYears() %>'><%= cust.getCExpYears() %></option>
          <option value='13'>2013</option>
          <option value='14'>2014</option>
          <option value='15'>2015</option>
          <option value='16'>2016</option>
          <option value='17'>2017</option>
          <option value='18'>2018</option>
          <option value='19'>2019</option>
          <option value='20'>2020</option>
          <option value='20'>2021</option>
         </select>
      </td>
     </tr>
      </table>
     </td>
    </tr>
    <tr>
     <th>Bank Phone(optional) :</th>
     <td>
      <input type='text' name='bankPhone' size='28' maxlength='20' value='<%= cust.getBankPhone() %>'/>
	<span id='bph' class='tipz'><img id='bph' class='tipz' src='./img/it/hlp.gif' alt=""/></span>
     </td>
  </tr>
   </table>
   <br/>
   <input class='ch_bt' type='submit' name='mode' value='Checkout'/><br/>

   <p class='messg'>
    We encourage customers to use the same billing and shipping address for all credit card orders to save time on order
    processing and credit card verification
    <a href='<%= info %>Payment.jsp'>procedures.</a>
    Billing address (address where credit card bank statement is mailed) has to be entered on the order with high accuracy.
    CompuVest electronic system is checking this information at the time of the order processing. If information is
    incorrect or incomplete the order will not be shipped. We usually notify customers by either a telephone call or
    email about a credit card processing problem. If we do not receive a call back from a customer within two business
    days in order to correct this information, the order will be canceled.
   </p>
   <p class='messg' style='font-size:10px;color:red;'><b>Useful tip:</b><br/> If you pay by American Express and your order
    exceeds $1000.00, please call American Express customer service to authorize your "ship to address". We always check
    if American Express has an ultimate shipping address on cardholder's file. This is a part of our usual procedure.
    By following these regulations you will save a lot of time and your order will be shipped without any delays.</p>

  </div> <%-- id="CC" --%>
<%      } %>

  <div class="panel" style="padding: 20px 10px;" id="PP">

 <button type='submit' name='mode' value='Checkout'><img alt='Checkout' src='../img/it/paypal_out.gif'/></button>
  <p class='messg'>
<%
        if(isUSAorCanada) {
%>
  Use PayPal free and secure payment system. Please ensure your address is an exact match to your PayPal
  account - otherwise your order may be rejected or denied.<br/>
  <b style="color:blue;">PayPal is only accepted for US customers.</b>
<%
        } else {
%>
  <font size='+1' color='red'>International Payments:</font><br/>
  <b>Attention All International Customer:</b>
   At this time we can only accept International Credit Cards through PayPal.
   All Major credit cards are accepted through PayPal.You can either pay through your PayPal account or use your credit card directly
   through PayPal. If you do not have a PayPal account please click the link to set up an account -
   <a href='https://www.paypal.com/' target='_blank'>https://www.paypal.com/</a>.
   Please note that International orders may take up to 48 business hours to be processed in our system.
   If payment is denied by PayPal please make payment either by Wire Transfer or Western Union.
<%
        }
%>
  </p>

  </div> <%-- id="PP" --%>

 <%--      if(isUSAorCanada) { %>
  <div class="panel" style="padding: 20px 10px;" id="CD">

 <p class='messg'>
  <b>&#8226;</b> We accept payment by your personal or company check in the amount of up to $1,000.<br/>
  <b>&#8226;</b> All fields in this form  are required.<br/>
  <b>&#8226;</b> You  payment is subject to approve by Telecheck Services.<br/>
  <b>&#8226;</b> If your payment is not approved, we will notify you by email.<br/>
 </p>
  <br/>
  <table style='width:98%;'>
   <tr>
    <td>
     <table id='custform' style='text-align:left;'>
      <tr><th>Check number :</th><td><input type='text' name='checkNumber' size='18' maxlength='4' value='<%= cust.getCheckNumber() %>'/></td></tr>
      <tr><th>Account number :</th><td><input type='text' name='checkAccount' size='18' maxlength='10' value='<%= cust.getCheckAccountNumber() %>'/></td></tr>
      <tr><th>Routing number :</th><td><input type='text' name='checkRouting' size='18' maxlength='9' value='<%= cust.getCheckRoutingNumber() %>'/></td></tr>
      <tr><th>Drivers License number :</th><td><input type='text' name='licenseNumber' size='18' maxlength='12' value='<%= cust.getLicenseNumber() %>'/></td></tr>
      <tr>
       <th>Drivers License State :</th>
       <td>
       <select name='licenseState'>
        <option value=''/>
        <%= advertShow.getUsaStateList(cust.getLicenseState()) %>
       </select>
       </td>
      </tr>
     </table>
    </td>
    <td><img src='../img/it/check.jpg' alt=""/></td>
   </tr>
  </table>
  <br/>
  <input  class='ch_bt' type='submit' name='mode' value='Checkout'/>

  </div>
 <%      } --%>
 <%-- id="CD" --%>
 
  <div class="panel" style="padding: 20px 10px;" id="UN">

 <input  class='ch_bt' type='submit' name='mode' value='Checkout'/> <br/>
 <p class='messg'>
  Western Union is fastest and most convenient way to pay for International Orders.
  Unfortunately due to certain financial regulations, not all countries are allowed to send US currency out.
  Please check the
  <a href='http://www.westernunion.com/info/selectCountry.asp?country=global'>list of countries</a>,
  where this service is available.
  If it is not available in you country, please make a payment through either
  <a href='https://www.paypal.com/' target='_blank'>PayPal</a> or a Wire Transfer.
 </p>

  </div> <%-- id="UN" --%>

<%      if(! isUSAorCanada) { %>
  <div class="panel" style="padding: 20px 10px;" id="WT">

  <input  class='ch_bt' type='submit' name='mode' value='Checkout'/> <br/>
  <p class='messg'>
  <font size='+1' color='red'>Wire transfer : </font><br/>
  Orders from any country are accepted. There are no amount limits for your order.
  Please make sure to provide order confirmation number in the details section when you are sending the Wire Transfer.
  You will be emailed payment instructions to make your wire transfer.
  </p>

  </div> <%-- id="WT" --%>
<%      } %>

<%--
  <div class="panel" style="padding: 20px 10px;" id="GG">

 <p class='messg' style='text-align:justify;'>
  Use Google free and secure payment system. Please ensure your address is an exact match to your Google
  account - otherwise your order may be rejected or denied.<br/>
  <font color=blue>Google is only accepted for US customers.</font>
 </p>
 <button type='submit' name='mode' value='Checkout'><img src='../images/checkout.gif' alt=''/></button>

  </div> // id="GG"
--%>


 </div> <%-- panels --%>
</div> <%-- id="cvTabs" --%>
</div>
<script type="text/javascript">window.addEvent('domready', function(){ new cvTabs('cvTabs'); } );</script>



<%
    } //  if(basket.isEmpty())
%>

</form>

    </td>
    <td id='cvright' valign="top">

    </td>
   </tr>
  </tbody>
  </table>
 </div>

 <div id='cvfoot'></div>
</div>

</body>
</html>
